Repository navigation
fix(gax): make CompositeTracer completion-callback scoping best-effort - #15121
jinseopkim0 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates CompositeTracer to handle exceptions thrown when entering or closing tracer scopes during completion callbacks, preventing RPC futures from hanging or skipping remaining callbacks. It also introduces comprehensive tests to verify this behavior. The review feedback highlights two main points: first, a suggestion to reorder assertions in the test to prevent potential flakiness from asynchronous execution; second, a concern that using a static JVM-wide AtomicBoolean to suppress duplicate warning logs could inadvertently hide critical tracer failures in other parts of the application.
| */ | ||
| @NullMarked | ||
| @InternalApi | ||
| class CompositeTracer extends BaseApiTracer { |
There was a problem hiding this comment.
General question: Do you know if this also works for streaming? I don't recall the details but IIUC BasicRetryingFuture is for unary, but I don't recall how streaming flows
There was a problem hiding this comment.
Yes, it works for all streaming types as well:
- Server streaming actually uses
BasicRetryingFuture(viaRetryingServerStreamingCallable) for retry attempt callbacks, andTracedResponseObserverforoperationSucceeded/operationFailed/operationCancelled. - Client and bidi streaming don't use
BasicRetryingFuture, but both invoketracer.operation*()insideTracedResponseObserverright before callinginnerObserver.onComplete()/onError(). With best-effort scoping inCompositeTracer, a scope failure can't prevent the user's stream observer from receiving terminal completion/error callbacks.
|
|





Makes
CompositeTracercompletion-callback scoping best-effort viadispatchCompletionCallback, logging scope enter/close failures atFINEso child callbacks and RPC future completion are not disrupted.b/499388983